﻿<!DOCTYPE html>
<!--申请修改审批-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <link href="/static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="/static/js/vue-treeselect/vue-treeselect.js"></script>
    <script>

    </script>
    <style>
        .popupW100 .el-input-group__prepend {}

        .popupW50 .el-form-item__label {
            width: 80px !important;
        }
    </style>
    <style>
        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-row>
            <el-col :span="24">
                <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                    style="margin-bottom: 15px;">

                    <el-row>
                        <el-col class="head-tool">
                            
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />申请修改审批列表</strong>
                            </div>

                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                    @click="onSubmit"></btn>


                                <btn-export-list url="xxxx" :forminline="this.formInline" linetype="4">
                                </btn-export-list>

                            </span>
                        </el-col>
                    </el-row>
                    <el-row>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.RegionName+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.RegionName" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.RegionName"
                                            @change="getNext($event)">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in RegionName" :label="item.label" :value="item.id">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.RiskPosition+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.RiskPosition" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.RiskPosition">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in RiskPosition" :label="item.label"
                                                :value="item.id"></el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <!-- <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.OrganizationType+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.OrganizationType" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.OrganizationType">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in OrganizationType" :label="item.value"
                                                :value="item.key"></el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col> -->


                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.Organizationlevel+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.Organizationlevel" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.Organizationlevel">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in Organizationlevel" :label="item.value"
                                                :value="item.key"></el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.InspectTime+'开始'+mark.m}}
                                        </template>
                                        <el-date-picker v-model="formInline.model.CheckTimeBegin" type="date"
                                            slot="suffix" size="mini" placeholder="选择日期">
                                        </el-date-picker>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.InspectTime+'结束'+mark.m}}
                                        </template>
                                        <el-date-picker v-model="formInline.model.CheckTimeEnd" type="date"
                                            slot="suffix" size="mini" placeholder="选择日期">
                                        </el-date-picker>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <!--<el-col :xs="8" :sm="8" :md="8" :lg="6" :xl="6">
        <div class="elst-select-mini">
            <el-form-item>
                <el-input v-model="formInline.model.InspectTime" :placeholder="RisksManagement.ApplyModifyApproval.InspectTime" size="mini">
                    <template slot="prepend">
                        {{RisksManagement.ApplyModifyApproval.InspectTime+mark.m}}
                    </template>
                </el-input>
            </el-form-item>
        </div>
    </el-col>-->






                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.InspectType+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.InspectType" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.InspectType">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in InspectType" :label="item.value"
                                                :value="item.key"></el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>


                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.RiskType+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.RiskType" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.RiskType">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in RiskType" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>


                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.RiskLevel+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.RiskLevel" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.RiskLevel">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in RiskLevel" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>











                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.RectificationDepartment+mark.m}}
                                        </template>
                                        <treeselect v-model="formInline.model.RectificationDepartment"
                                            :options="RectificationDepartment" :flat="true" :show-count="true"
                                            :disable-branch-nodes="true" slot="suffix" placeholder="请选择"
                                            style="line-height: 28px;width:50%;float: right;" />

                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>




                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.RectificationLeading+mark.m}}
                                        </template>
                                        <treeselect v-model="formInline.model.RectificationLeading"
                                            :options="RectificationLeading" :flat="true" :show-count="true"
                                            :disable-branch-nodes="true" slot="suffix" placeholder="请选择"
                                            style="line-height: 28px;width:50%;float: right;" />

                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>

                        <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input size="mini">
                                        <template slot="prepend">
                                            {{RisksManagement.ApplyModifyApproval.Status+mark.m}}
                                        </template>
                                        <el-select @visible-change="visibleChange" v-model="formInline.model.aState" slot="suffix"
                                            :placeholder="RisksManagement.ApplyModifyApproval.Status">
                                            <el-option label="请选择" value=""></el-option>
                                            <el-option v-for="item in aState" :label="item.value" :value="item.key">
                                            </el-option>
                                        </el-select>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>





                    </el-row>
                </el-form>

                <el-table stripe ref="table" :data="ListItem.tableData" :height="ListItem.tableHeight" border
                    @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                    <!--<el-table-column type="selection" align="center" width="55">
    </el-table-column>-->
                    <!---序号--->
                    <!--<el-table-column prop="id"
                                     :label="RisksManagement.ApplyModifyApproval.id"
                                     width="180">
                        <template slot-scope="scope">
                            {{scope.row.id}}
                        </template>
                    </el-table-column>-->

                    <el-table-column type="index" :label="RisksManagement.ApplyModifyApproval.id" width="50"
                        show-overflow-tooltip="true" :index="indexMethod">
                    </el-table-column>

                    <!---隐患治理编号--->
                    <el-table-column prop="troubleNum" :formatter="getDicValue" min-width="130"
                        show-overflow-tooltip="true" :label="RisksManagement.RiskReport.troubleNum">
                    </el-table-column>
                    <!---机构类别--->
                    <!--<el-table-column prop="InstitutionTypes"
                     width="100"
                     :label="RisksManagement.ApplyModifyApproval.InstitutionTypes">
    </el-table-column>-->
                    <!---单位名称--->
                    <!--<el-table-column prop="CompanyName"
                     width="100"
                     :label="RisksManagement.ApplyModifyApproval.CompanyName">
    </el-table-column>-->
                    <!---区域名称--->
                    <el-table-column prop="RegionName" :formatter="getDicValue" show-overflow-tooltip="true" width="100"
                        :label="RisksManagement.ApplyModifyApproval.RegionName">
                    </el-table-column>

                    <!---隐患位置--->
                    <el-table-column prop="RiskPosition" :formatter="getDicValue" show-overflow-tooltip="true"
                        width="100" :label="RisksManagement.ApplyModifyApproval.RiskPosition">
                    </el-table-column>

                    <!---组织类别--->
                    <el-table-column prop="OrganizationType" :formatter="getDicValue" show-overflow-tooltip="true"
                        width="100" :label="RisksManagement.ApplyModifyApproval.OrganizationType">
                    </el-table-column>

                    <!---检查时间--->
                    <el-table-column prop="CheckTime" show-overflow-tooltip="true" width="100"
                        :label="RisksManagement.ApplyModifyApproval.InspectTime">
                    </el-table-column>

                    <!---检查类别--->
                    <el-table-column prop="InspectType" :formatter="getDicValue" show-overflow-tooltip="true"
                        width="100" :label="RisksManagement.ApplyModifyApproval.InspectType">
                    </el-table-column>

                    <!---隐患描述--->
                    <el-table-column prop="RiskDescription" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.RiskDescription">
                    </el-table-column>

                    <!---隐患分类--->
                    <el-table-column prop="RiskType" :formatter="getDicValue" show-overflow-tooltip="true" width="100"
                        :label="RisksManagement.ApplyModifyApproval.RiskType">
                    </el-table-column>

                    <!---隐患级别--->
                    <el-table-column prop="RiskLevel" :formatter="getDicValue" show-overflow-tooltip="true" width="100"
                        :label="RisksManagement.ApplyModifyApproval.RiskLevel">
                    </el-table-column>

                    <!---整改目标或方案--->
                    <el-table-column prop="RectificationCase" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.RectificationCase">
                    </el-table-column>


                    <!---整改资金（元）--->
                    <el-table-column prop="RectificationFund" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.RectificationFund">
                    </el-table-column>

                    <!---整改负责人--->
                    <el-table-column prop="RectificationLeading" show-overflow-tooltip="true"
                        width="100" :label="RisksManagement.ApplyModifyApproval.RectificationLeading">
                    </el-table-column>

                    <!---整改责任部门--->
                    <el-table-column prop="Department" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.Department">
                    </el-table-column>

                    <!---计划完成时间--->
                    <el-table-column prop="PlanTime" show-overflow-tooltip="true" width="120"
                        :label="RisksManagement.ApplyModifyApproval.PlanTime">
                    </el-table-column>

                    <!---当前控制措施--->
                    <el-table-column prop="CurrentPlan" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.CurrentPlan">
                    </el-table-column>

                    <!---是否制定应急预案--->
                    <el-table-column prop="HaveContingencyPlan" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.HaveContingencyPlan">
                    </el-table-column>

                    <!---整改人--->
                    <el-table-column prop="Rectification" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.Rectification">
                    </el-table-column>

                    <!---实际完成时间--->
                    <el-table-column prop="ActualTime" show-overflow-tooltip="true" width="120"
                        :label="RisksManagement.ApplyModifyApproval.ActualTime">
                    </el-table-column>

                    <!---整改前照片--->
                    <el-table-column prop="" width="200" :label="RisksManagement.ApplyModifyApproval.BeforeRImg">
                        <template slot-scope="scope">
                            <img :src="scope.row.BeforeRImg" width="100" height="50" />
                        </template>
                    </el-table-column>

                    <!---整改后照片--->
                    <el-table-column prop="" width="200" :label="RisksManagement.ApplyModifyApproval.AfterRImg">
                        <template slot-scope="scope">
                            <el-image :src="scope.row.AfterRImg" fit="fill" width="100" height="50">
                            </el-image>
                        </template>
                    </el-table-column>

                    <!---验收人--->
                    <el-table-column prop="AppointPerson" show-overflow-tooltip="true" width="100"
                        :label="RisksManagement.ApplyModifyApproval.AppointPerson">
                    </el-table-column>

                    <!---验收时间--->
                    <el-table-column prop="AppointTime" show-overflow-tooltip="true" width="100"
                        :label="RisksManagement.ApplyModifyApproval.AppointTime">
                    </el-table-column>

                    <!---验收意见--->
                    <el-table-column prop="ApprovalResult" show-overflow-tooltip="true" width="200"
                        :label="RisksManagement.ApplyModifyApproval.ApprovalResult">
                    </el-table-column>

                    <!---状态--->
                    <el-table-column prop="aState" :formatter="getDicValue" width="100"
                        :label="RisksManagement.ApplyModifyApproval.Status">
                    </el-table-column>

                    <!---明细--->
                    <el-table-column prop="" :formatter="getDicValue" width="70"
                        :label="col.stWork" fixed="right">
                        <template slot-scope="scope">
                            <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                                <i class="el-icon-search"></i>
                            </button>
                        </template>
                    </el-table-column>


                </el-table>
                <el-row type="flex" justify="end">


                    <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                        :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                        :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                    </el-pagination>

                </el-row>
            </el-col>
        </el-row>
        <el-dialog :title="dialogTitle" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%"
            height="80%" top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',

            data: function () {
                return {
                    dialogTitle: '隐患基础信息',
                    //页面内左树
                    mydata: PersonInChargeTree,
                    Region: myTree,
                    RegionName: [],
                    RiskPosition: [],
                    RiskLevel: [],
                    RiskType: [],
                    OrganizationType: [],
                    InspectType: [],
                    RectificationLeading: [],
                    // changhy S
                    RectificationDepartment: [],
                    Organizationlevel: [],
                    // changhy E
                    aState: [],
                    //页面内数据初始化
                    ListItem: ListItem,
                    formInline: {
                        model: {
                            RegionName: '',
                            RiskPosition: '',
                            OrganizationType: '',
                            InspectTime: '',
                            InspectType: '',
                            RiskType: '',
                            RiskLevel: '',
                            aState: '',
                            RectificationLeading: null,
                            // changhy S
                            RectificationDepartment: null,
                            Organizationlevel: '',
                            // changhy E
                            CheckTimeBegin: '',
                            CheckTimeEnd: '',
                        },
                        offset: 0,
                        limit: 10
                    }
                }
            },
            created: function () {
                var currApp = this;
                window.onresize = function () {
                    currApp.ListItem.tableHeight = window.innerHeight -
                        currApp.$refs.table.$el.offsetTop - 60;
                    if (currApp.ListItem.tableHeight < 112) {
                        currApp.ListItem.tableHeight = 112;
                    }
                }
            },
            mounted: function () {
                //获取下拉菜单内容
                this.RiskLevel = getDicData('03');//字典内容
                this.InspectType = getDicData('101');
                this.RiskType = getDicData('100');
                this.aState = getDicData('82'); //状态
                this.OrganizationType = getDicData("103")
                this.RectificationLeading = fn(this.mydata, "0");
                // changhy S
                this.RectificationDepartment = fn(this.mydata, "0");
                this.Organizationlevel = getDicData("103")
                // changhy E
                this.RegionName = fn(this.Region, "0");
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                //this.TreeData = fn(this.mydata, "0");
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                getDicValue: function (row, column, cellValue, index) {
                    switch (column.property) {

                        case "OrganizationType":
                            return getDicValue('103', cellValue)
                            break;
                        case "InspectType":
                            return getDicValue('101', cellValue)
                            break;
                        case "RiskType":
                            return getDicValue('100', cellValue)
                            break;
                        case "ReportType":
                            return getDicValue('102', cellValue)
                            break;
                        case "RiskLevel":
                            return getDicValue('03', cellValue)
                            break;

                        case "aState":
                            return getDicValue('82', cellValue)
                            break;

                        case "RegionName":
                            return getTreeValue(this.Region, cellValue); break;
                        case "RiskPosition":
                            return getTreeValue(this.Region, cellValue); break;
                        case "RectificationLeading":
                            return getTreeValue(this.mydata, cellValue); break;
                        default:
                            return cellValue; break;
                    }

                },
                //二级联动
                getNext: function (prov) {
                    this.RiskPosition = [];
                    this.formInline.model.RiskPosition = '';
                    this.RiskPosition = fn(this.Region, prov);

                },

                handleNodeClick: function (data) {
                    //当前节点如果为最底层的才触发新的查询?暂时先这么处理,如果每层节点都查询就把判断去掉,并在接口逻辑模糊查询
                    if (!data.children) {
                        this.formInline.model.TreeNode = data.id
                        onSubmit(this);
                    }

                },
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/ApplyModifyApproval/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "ApplyModifyApprovalInput.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/ApplyModifyApproval/GetRiskSel') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //序号排列方法
                indexMethod: function (index) { return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1; },
            }
        });

    </script>
</body>

</html>